473,480 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to Convert VB6 code in C# is there any Translator Available

1 New Member
Some time ago i have developed an application in VB6 now i want to use this application in C#, Can anyone tell me how can i conver VB6 code in C# code is there any Translator available? or first i have to convert VB6>VB.net and than from VB.net to C# what are the possibilites please help!

Thank You
Adnan Khan
Jan 15 '07 #1
13 19554
r035198x
13,262 MVP
Some time ago i have developed an application in VB6 now i want to use this application in C#, Can anyone tell me how can i conver VB6 code in C# code is there any Translator available? or first i have to convert VB6>VB.net and than from VB.net to C# what are the possibilites please help!

Thank You
Adnan Khan
You may need to post this in the C# forum as well.
Jan 16 '07 #2
Motoma
3,237 Recognized Expert Specialist
I don't know of any direct way, however, if the VB6 code works correctly, you could compile it as a DLL and add it to the references in your C# project.
Jan 18 '07 #3
NH1
12 New Member
You might already have solved it, but anyway:

SharpDevelop has a build in option to convert vb.net to c# and c# to vb.net (okay, it's for the .net framework, but if you back-up your code, you can always try...). (I have the program installed but never used the option... so don't know how good it works...)

Oh, it's a free program...
Jan 30 '07 #4
Motoma
3,237 Recognized Expert Specialist
You might already have solved it, but anyway:

SharpDevelop has a build in option to convert vb.net to c# and c# to vb.net (okay, it's for the .net framework, but if you back-up your code, you can always try...). (I have the program installed but never used the option... so don't know how good it works...)

Oh, it's a free program...
That's cool, except the question was about VB6.
Jan 31 '07 #5
genji
1 New Member
That's cool, except the question was about VB6.
There is no easy way to "convert" from VB6 to any .Net Language. Since VB.Net is an object oriented language and VB6 is a linear language, you actually have to rewrite it.

The simplest thing to do is create one class in VB.Net and translate all of your VB6 functions into it. This is not easy and requires knowledge of VB.Net and the difference in syntax between VB6 and VB.Net

However, once its in VB.Net there are a few tools (e.g. SharpDevelop) that will translate to C# or other .Net languages (also not always perfectly and may require some manual fixes.)
Feb 1 '07 #6
Motoma
3,237 Recognized Expert Specialist
There is no easy way to "convert" from VB6 to any .Net Language. Since VB.Net is an object oriented language and VB6 is a linear language, you actually have to rewrite it.

The simplest thing to do is create one class in VB.Net and translate all of your VB6 functions into it. This is not easy and requires knowledge of VB.Net and the difference in syntax between VB6 and VB.Net

However, once its in VB.Net there are a few tools (e.g. SharpDevelop) that will translate to C# or other .Net languages (also not always perfectly and may require some manual fixes.)
Welcome to The Scripts genji.
Feb 1 '07 #7
nmadct
83 Recognized Expert New Member
The fruits of my Google search:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriUpgradingFromVisualBasic60.asp
http://sharptoolbox.com/categories/code-converters-language-migration
http://www.artinsoft.com/pr_vbcompanion.aspx

From MSDN:

"Visual Basic .NET enables a fundamental shift from traditional Windows development to building next-generation Web and n-tier applications. For this reason, your code will need to be upgraded to take advantage of Visual Basic .NET.

"This happens automatically when you open a Visual Basic 6.0 project in Visual Basic .NET: the Upgrade Wizard steps you through the upgrade process and creates a new Visual Basic .NET project (your existing project is left unchanged). This is a one-way process; the new Visual Basic .NET project cannot be opened in Visual Basic 6.0."

There are some changes you will have to make before and after, however. It will definitely be work if you have lots of code.
Feb 3 '07 #8
Dököll
2,364 Recognized Expert Top Contributor
This may not be what you want, but I was excited to found out another possibility for work. If you are interested in Java, and I will understand if you do not, you may consider converting to it, see if you like the results; for a certain amount of moola that is. Please understand I have yet to try this for work projects. My boss, hoeve, is very elated about the change since most of our applications are written in Java, I just happen to like VB more. Anyway, here:

http://www.diamondedge.com/products/Convert-VB-to-Java.html

http://www.google.com/search?hl=en&q=Convert+VB+6.0+app+to+java


Give both links a look. In a bit!

Dököll
Feb 3 '07 #9
wjack
1 New Member
Try this tool

http://www.e-iceblue.com/transking/faq.htm

Best Regards
wjack
Mar 23 '07 #10
EDJohnson
1 New Member
You might already have solved it, but anyway:

SharpDevelop has a build in option to convert vb.net to c# and c# to vb.net (okay, it's for the .net framework, but if you back-up your code, you can always try...). (I have the program installed but never used the option... so don't know how good it works...)

Oh, it's a free program...
Does SharpDevelop work for the CompactFramework as well?

Thanks
Apr 23 '07 #11
jooo
1 New Member
Good web site to convert from Vb to C#
<link removed: not working>
Oct 8 '09 #12
Frinavale
9,735 Recognized Expert Moderator Expert
Here is a a website that helps compare/translate VB.NET -> C#:

VB.NET and C# Comparison
Oct 20 '09 #13
mjuras
3 New Member
It is absolutely possible to automatically convert VB6 directly to C#, automatically replace 3rd party COM with .NET classes, and even automatically convert ASP to ASP.NET. The little known secret is to use a conversion tool that you can customize to meet the unique needs of your source code and .NET development standards. Your results will not be 100% "perfect" on day-one, but then again neither will a hand rewrite. See samples and documentation at www.greatmigrations.com.

See also http://bytes.com/topic/net/answers/8...ing-vb6-vb-net
Dec 5 '09 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

31
1776
by: Michael Nicol | last post by:
Hey all Our company recently started using .net and started in VB.NET. We've since changed to c#, but has some code already written in VB.NET. I'm looking for a converter that will just take...
2
28798
by: Barney | last post by:
I have to convert a Java app to .NET, i found and used the conversion tool which converts java to C#, but it only converted about 10% of it, how hard would it be to re-write the java app and keep...
3
14904
by: Tom | last post by:
Hi, I built an application with VB many years ago and I want to use C# and dot net framework now. How can I convert the VB6 code to C#? Do I need to firstly convert VB6 code to VB.net and...
14
1782
by: John Smith | last post by:
Can someone convert from C# into VB this line for me: if (c is System.Web.UI.HtmlControls.HtmlForm)
0
7039
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7037
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
6895
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5326
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4770
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1296
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
176
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.